package handler

import (
	"github.com/gin-gonic/gin"
	"medi-clinic/model"
)

func List(c *gin.Context) {
	var data []model.Clinic
	err := model.DB.Find(&data).Error
	if err != nil {
		c.JSON(200, gin.H{
			"code": 500,
			"msg":  "查询失败",
		})
		return
	}
	c.JSON(200, gin.H{
		"code": 200,
		"msg":  "查询成功",
		"data": data,
	})
	return
}
